home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume25 / byte-benchmarks3.1 / part02 < prev    next >
Encoding:
Text File  |  1992-02-01  |  53.6 KB  |  1,791 lines

  1. Newsgroups: comp.sources.unix
  2. From: ben@bytepb.byte.com (Ben Smith @ BYTE)
  3. Subject: v25i109: BYTE Benchmarks, V3.1, Part02/04
  4. Sender: sources-moderator@pa.dec.com
  5. Approved: vixie@pa.dec.com
  6.  
  7. Submitted-By: ben@bytepb.byte.com (Ben Smith @ BYTE)
  8. Posting-Number: Volume 25, Issue 109
  9. Archive-Name: byte-benchmarks3.1/part02
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 2 (of 4)."
  18. # Contents:  Makefile results/reports.shar src/dhry_2.c src/dummy.c
  19. #   src/fstime.c testdir/cctest.c testdir/sort.src
  20. # Wrapped by vixie@cognition.pa.dec.com on Sun Feb  2 16:27:40 1992
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  23.   echo shar: Will not clobber existing file \"'Makefile'\"
  24. else
  25. echo shar: Extracting \"'Makefile'\" \(8076 characters\)
  26. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  27. X##############################################################################
  28. X#  The BYTE UNIX Benchmarks - Release 3
  29. X#          Module: Makefile   SID: 3.9 5/15/91 19:30:15
  30. X#          
  31. X##############################################################################
  32. X# Bug reports, patches, comments, suggestions should be sent to:
  33. X#
  34. X#    Ben Smith or Tom Yager at BYTE Magazine
  35. X#    bensmith@bytepb.byte.com    tyager@bytepb.byte.com
  36. X#
  37. X##############################################################################
  38. X#  Modification Log: 7/28/89 cleaned out workload files
  39. X#                    4/17/90 added routines for installing from shar mess
  40. X#                    7/23/90 added compile for dhrystone version 2.1
  41. X#                          (this is not part of Run file. still use old)
  42. X#                          removed HZ from everything but dhry.
  43. X#                          HZ is read from the environment, if not
  44. X#                          there, you must define it in this file
  45. X#                    10/30/90 moved new dhrystone into standard set
  46. X#                          new pgms (dhry included) run for a specified
  47. X#                          time rather than specified number of loops
  48. X#                    4/5/91 cleaned out files not needed for
  49. X#                          release 3 -- added release 3 files -ben
  50. X##############################################################################
  51. ID="@(#)Makefile:3.9 -- 5/15/91 19:30:15";
  52. SHELL = /bin/sh
  53. X#HZ = ????         #(read from environment)
  54. CFLAGS = -DTIME
  55. OPTON = -O        #optimization on (give it your best shot) 
  56. X                  #            -- check your compiler man
  57. OPTOFF = -Od      #optimization off -- check your compiler man
  58. X# local directories
  59. PROGDIR = ./pgms
  60. SRCDIR = ./src
  61. DOCDIR = ./doc
  62. TESTDIR = ./testdir
  63. RESULTDIR = ./results
  64. TMPDIR = ./tmp
  65. X# other directories
  66. INCLDIR = /usr/include
  67. LIBDIR = /lib
  68. SCRIPTS = byte.logo cleanup.sh \
  69. X    fs.awk multi.sh tst.sh index.sh index.base \
  70. X    index.awk loops.awk loopm.awk\
  71. X    report.sh report.awk
  72. SOURCES = arith.c big.c context1.c \
  73. X    dummy.c execl.c \
  74. X    fstime.c getopt.c hanoi.c \
  75. X    pipe.c spawn.c limit.c \
  76. X    syscall.c looper.c timeit.c \
  77. X    dhry_1.c dhry_2.c dhry.h 
  78. DOCS = bench.doc bench3.doc
  79. TESTS = sort.src cctest.c dc.dat
  80. RESULTS = reports.shar
  81. BINS = $(PROGDIR)/arithoh $(PROGDIR)/register $(PROGDIR)/short \
  82. X    $(PROGDIR)/int $(PROGDIR)/long $(PROGDIR)/float $(PROGDIR)/double \
  83. X    $(PROGDIR)/hanoi \
  84. X    $(PROGDIR)/fstime $(PROGDIR)/syscall $(PROGDIR)/context1 \
  85. X    $(PROGDIR)/pipe $(PROGDIR)/spawn $(PROGDIR)/execl \
  86. X    $(PROGDIR)/dhry2 $(PROGDIR)/dhry2reg  $(PROGDIR)/looper
  87. REQD = $(BINS) $(PROGDIR)/byte.logo $(PROGDIR)/cleanup.sh  \
  88. X    $(PROGDIR)/fs.awk $(PROGDIR)/multi.sh \
  89. X    $(PROGDIR)/tst.sh $(PROGDIR)/index.sh $(PROGDIR)/index.base \
  90. X    $(PROGDIR)/index.awk $(PROGDIR)/loops.awk $(PROGDIR)/loopm.awk \
  91. X    $(PROGDIR)/report.sh $(PROGDIR)/report.awk \
  92. X    $(TESTDIR)/sort.src $(TESTDIR)/cctest.c $(TESTDIR)/dc.dat
  93. X
  94. X# ######################### the big ALL ############################
  95. all: distr programs
  96. X    @chmod 744 * $(SRCDIR)/* $(PROGDIR)/* $(TESTDIR)/* $(DOCDIR)/*
  97. X
  98. X# ####################### a check for Run ######################
  99. check: $(REQD)
  100. X    make all
  101. X# ##############################################################
  102. X# distribute the files out to subdirectories if they are in this one
  103. distr: 
  104. X    @echo "Checking distribution of files"
  105. X# scripts
  106. X    @if  test ! -d  $(PROGDIR) \
  107. X        ; then  \
  108. X           mkdir $(PROGDIR) \
  109. X           ; mv $(SCRIPTS) $(PROGDIR) \
  110. X        ; else \
  111. X           echo "$(PROGDIR)  exists" \
  112. X        ; fi
  113. X# C sources
  114. X    @if  test ! -d  $(SRCDIR) \
  115. X        ; then  \
  116. X           mkdir $(SRCDIR) \
  117. X           ; mv $(SOURCES) $(SRCDIR) \
  118. X        ; else \
  119. X           echo "$(SRCDIR)  exists" \
  120. X        ; fi
  121. X# test data
  122. X    @if  test ! -d  $(TESTDIR) \
  123. X        ; then  \
  124. X           mkdir $(TESTDIR) \
  125. X           ; mv $(TESTS) $(TESTDIR) \
  126. X        ; else \
  127. X           echo "$(TESTDIR)  exists" \
  128. X        ; fi
  129. X# documents directory
  130. X    @if  test ! -d  $(DOCDIR) \
  131. X        ; then  \
  132. X           mkdir $(DOCDIR) \
  133. X       ; mv $(DOCS) $(DOCDIR) \
  134. X        ; else \
  135. X           echo "$(DOCDIR)  exists" \
  136. X        ; fi
  137. X# temporary work directory
  138. X    @if  test ! -d  $(TMPDIR) \
  139. X        ; then  \
  140. X           mkdir $(TMPDIR) \
  141. X        ; else \
  142. X           echo "$(TMPDIR)  exists" \
  143. X        ; fi
  144. X# directory for results
  145. X    @if  test ! -d  $(RESULTDIR) \
  146. X        ; then  \
  147. X           mkdir $(RESULTDIR) \
  148. X       ;  mv $(RESULTS) $(RESULTDIR) \
  149. X        ; else \
  150. X           echo "$(RESULTDIR)  exists" \
  151. X        ; fi
  152. X
  153. programs: $(BINS)
  154. X
  155. X# Individual programs
  156. X$(PROGDIR)/arithoh:    $(SRCDIR)/arith.c
  157. X    cc -o $(PROGDIR)/arithoh ${CFLAGS} ${OPTON} -Darithoh $(SRCDIR)/arith.c
  158. X$(PROGDIR)/register: $(SRCDIR)/arith.c
  159. X    cc -o $(PROGDIR)/register ${CFLAGS} ${OPTON} -Ddatum=register $(SRCDIR)/arith.c
  160. X$(PROGDIR)/short: $(SRCDIR)/arith.c
  161. X    cc -o $(PROGDIR)/short ${CFLAGS} ${OPTON} -Ddatum=short $(SRCDIR)/arith.c
  162. X$(PROGDIR)/int: $(SRCDIR)/arith.c
  163. X    cc -o $(PROGDIR)/int ${CFLAGS} ${OPTON} -Ddatum=int $(SRCDIR)/arith.c
  164. X$(PROGDIR)/long: $(SRCDIR)/arith.c
  165. X    cc -o $(PROGDIR)/long ${CFLAGS} ${OPTON} -Ddatum=long $(SRCDIR)/arith.c
  166. X$(PROGDIR)/float: $(SRCDIR)/arith.c
  167. X    cc -o $(PROGDIR)/float ${CFLAGS} ${OPTON} -Ddatum=float $(SRCDIR)/arith.c
  168. X$(PROGDIR)/double: $(SRCDIR)/arith.c
  169. X    cc -o $(PROGDIR)/double ${CFLAGS} ${OPTON} -Ddatum=double $(SRCDIR)/arith.c
  170. X$(PROGDIR)/hanoi: $(SRCDIR)/hanoi.c
  171. X    cc -o $(PROGDIR)/hanoi ${CFLAGS} ${OPTON} $(SRCDIR)/hanoi.c
  172. X$(PROGDIR)/fstime: $(SRCDIR)/fstime.c
  173. X    cc -o $(PROGDIR)/fstime ${CFLAGS} ${OPTON} -Dawk=1 $(SRCDIR)/fstime.c
  174. X$(PROGDIR)/syscall: $(SRCDIR)/syscall.c
  175. X    cc -o $(PROGDIR)/syscall ${CFLAGS} ${OPTON} $(SRCDIR)/syscall.c
  176. X$(PROGDIR)/context1: $(SRCDIR)/context1.c
  177. X    cc -o $(PROGDIR)/context1 ${CFLAGS} ${OPTON} $(SRCDIR)/context1.c
  178. X$(PROGDIR)/pipe: $(SRCDIR)/pipe.c
  179. X    cc -o $(PROGDIR)/pipe ${CFLAGS} ${OPTON} $(SRCDIR)/pipe.c
  180. X$(PROGDIR)/spawn: $(SRCDIR)/spawn.c
  181. X    cc -o $(PROGDIR)/spawn ${CFLAGS} ${OPTON} $(SRCDIR)/spawn.c
  182. X$(PROGDIR)/execl: $(SRCDIR)/execl.c $(SRCDIR)/big.c
  183. X    cc -o $(PROGDIR)/execl ${CFLAGS} ${OPTON} $(SRCDIR)/execl.c
  184. X$(PROGDIR)/dhry2: $(SRCDIR)/dhry_1.c $(SRCDIR)/dhry_2.c $(SRCDIR)/dhry.h
  185. X    cd $(SRCDIR); cc -c ${CFLAGS} -DHZ=${HZ} ${OPTON} dhry_1.c  
  186. X    cd $(SRCDIR); cc -c ${CFLAGS} -DHZ=${HZ} ${OPTON} dhry_2.c  
  187. X    cc -o $(PROGDIR)/dhry2 ${CFLAGS} ${OPTON} $(SRCDIR)/dhry_1.o $(SRCDIR)/dhry_2.o 
  188. X    cd $(SRCDIR); rm -f dhry_1.o dhry_2.o 
  189. X$(PROGDIR)/dhry2reg: $(SRCDIR)/dhry_1.c $(SRCDIR)/dhry_2.c $(SRCDIR)/dhry.h 
  190. X    cd $(SRCDIR); cc -c ${CFLAGS} -DREG=register -DHZ=${HZ} ${OPTON} dhry_1.c
  191. X    cd $(SRCDIR); cc -c ${CFLAGS} -DREG=register -DHZ=${HZ} ${OPTON} dhry_2.c
  192. X    cc -o $(PROGDIR)/dhry2reg ${CFLAGS} ${OPTON} $(SRCDIR)/dhry_1.o $(SRCDIR)/dhry_2.o
  193. X    cd $(SRCDIR); rm -f dhry_1.o dhry_2.o
  194. X$(PROGDIR)/looper: $(SRCDIR)/looper.c
  195. X    cc -o $(PROGDIR)/looper ${CFLAGS} ${OPTON} $(SRCDIR)/looper.c
  196. X
  197. X# Run the benchmarks and create the reports
  198. run:
  199. X    sh ./Run
  200. X
  201. report:
  202. X    sh pgms/report.sh results/log > results/report
  203. X    sh pgms/index.sh pgms/index.base results/log >> results/report
  204. X    cat results/report
  205. X
  206. X# SCCS stuff and disk reproduction
  207. clean:
  208. X    rm -f $(BINS)
  209. X
  210. delta:
  211. X    delta -y"development step" sccs/s.Run sccs/s.README
  212. X    cd src; delta -y"development step" sccs
  213. X    cd pgms; delta -y"development step" sccs
  214. X    cd testdir; delta -y"development step" sccs
  215. X    cd doc; delta -y"development step" sccs
  216. get:
  217. X    get -e sccs/s.Run sccs/s.README
  218. X    cd src; get -e sccs
  219. X    cd pgms; get -e sccs
  220. X    cd testdir; get -e sccs
  221. X    cd doc; get -e sccs
  222. X    chmod 744 $(SRCDIR)/* 
  223. X    chmod 755 $(PROGDIR)/* *
  224. rel:
  225. X    cd bench; rm -f Makefile Run README; get ../sccs
  226. X    cd bench/src; rm -f *; get ../../src/sccs
  227. X    cd bench/pgms; rm -f *; get ../../pgms/sccs
  228. X    cd bench/testdir; rm -f *; get ../../testdir/sccs
  229. X    cd bench/doc; rm -f *; get ../../doc/sccs
  230. X    cd bench; chmod 744 src/* testdir/*
  231. X    cd bench; chmod 755 * pgms/*
  232. X
  233. tar48:
  234. X    format /dev/rdsk/f05d9t 
  235. X    tar cfb /dev/rdsk/f05d9t 20 bench
  236. X    tar tf /dev/rdsk/f05d9t 
  237. X
  238. tar96:
  239. X    format /dev/rdsk/f05ht
  240. X    tar cfb /dev/rdsk/f05ht 20 bench
  241. X    tar tf /dev/rdsk/f05ht
  242. X
  243. tar135:
  244. X    format /dev/rdsk/f13dt
  245. X    tar cfb /dev/rdsk/f13dt 20 bench
  246. X    tar tf /dev/rdsk/f13dt
  247. END_OF_FILE
  248. if test 8076 -ne `wc -c <'Makefile'`; then
  249.     echo shar: \"'Makefile'\" unpacked with wrong size!
  250. fi
  251. chmod +x 'Makefile'
  252. # end of 'Makefile'
  253. fi
  254. if test -f 'results/reports.shar' -a "${1}" != "-c" ; then 
  255.   echo shar: Will not clobber existing file \"'results/reports.shar'\"
  256. else
  257. echo shar: Extracting \"'results/reports.shar'\" \(10505 characters\)
  258. sed "s/^X//" >'results/reports.shar' <<'END_OF_FILE'
  259. X#    This is a shell archive.
  260. X#    Remove everything above and including the cut line.
  261. X#    Then run the rest of the file through sh.
  262. X#----cut here-----cut here-----cut here-----cut here-----
  263. X#!/bin/sh
  264. X# shar:    Shell Archiver
  265. X#    Run the following text with /bin/sh to create:
  266. X#    hp425t.report
  267. X#    hp720.report
  268. X#    next040.report
  269. X# This archive created: Wed May 15 09:20:51 1991
  270. echo shar: extracting hp425t.report '(3051 characters)'
  271. sed 's/^XX//' << \ABRACADABRA > hp425t.report
  272. XXX
  273. XXX  BYTE UNIX Benchmarks (Version 3.9)
  274. XXX  System -- HP-UX hpfmcb49 B.08.00 B 9000/42E 08000915959e
  275. XXX  Start Benchmark Run: Thu May  9 14:31:51 EDT 1991
  276. XXX   1 interactive users.
  277. XXXDhrystone 2 without register variables    30581.5 lps   (10 secs, 6 samples)
  278. XXXDhrystone 2 using register variables      30573.8 lps   (10 secs, 6 samples)
  279. XXXArithmetic Test (type = arithoh)         1453209.6 lps   (10 secs, 6 samples)
  280. XXXArithmetic Test (type = register)          3238.6 lps   (10 secs, 6 samples)
  281. XXXArithmetic Test (type = short)             3512.9 lps   (10 secs, 6 samples)
  282. XXXArithmetic Test (type = int)               3239.2 lps   (10 secs, 6 samples)
  283. XXXArithmetic Test (type = long)              3238.5 lps   (10 secs, 6 samples)
  284. XXXArithmetic Test (type = float)             2654.7 lps   (10 secs, 6 samples)
  285. XXXArithmetic Test (type = double)            2871.3 lps   (10 secs, 6 samples)
  286. XXXSystem Call Overhead Test                  3630.7 lps   (10 secs, 6 samples)
  287. XXXPipe Throughput Test                       1284.4 lps   (10 secs, 6 samples)
  288. XXXPipe-based Context Switching Test           563.8 lps   (10 secs, 6 samples)
  289. XXXProcess Creation Test                        57.6 lps   (10 secs, 6 samples)
  290. XXXExecl Throughput Test                        43.4 lps   (9 secs, 6 samples)
  291. XXXFile Read  (10 seconds)                    6748.0 KBps  (10 secs, 6 samples)
  292. XXXFile Write (10 seconds)                    1200.0 KBps  (10 secs, 6 samples)
  293. XXXFile Copy  (10 seconds)                     746.0 KBps  (10 secs, 6 samples)
  294. XXXFile Read  (30 seconds)                    7077.0 KBps  (30 secs, 6 samples)
  295. XXXFile Write (30 seconds)                    1789.0 KBps  (30 secs, 6 samples)
  296. XXXFile Copy  (30 seconds)                     322.0 KBps  (30 secs, 6 samples)
  297. XXXC Compiler Test                              47.6 lpm   (60 secs, 3 samples)
  298. XXXShell scripts (1 concurrent)                 37.0 lpm   (60 secs, 3 samples)
  299. XXXShell scripts (2 concurrent)                 20.0 lpm   (60 secs, 3 samples)
  300. XXXShell scripts (4 concurrent)                 10.0 lpm   (60 secs, 3 samples)
  301. XXXShell scripts (8 concurrent)                  5.0 lpm   (60 secs, 3 samples)
  302. XXXDc: sqrt(2) to 99 decimal places           1205.2 lpm   (60 secs, 6 samples)
  303. XXXRecursion Test--Tower of Hanoi              508.2 lps   (10 secs, 6 samples)
  304. XXX
  305. XXX
  306. XXX                     INDEX VALUES            
  307. XXXTEST                                        BASELINE     RESULT      INDEX
  308. XXX
  309. XXXArithmetic Test (type = double)               2541.7     2871.3        1.1
  310. XXXDhrystone 2 without register variables       22366.3    30581.5        1.4
  311. XXXExecl Throughput Test                           16.5       43.4        2.6
  312. XXXFile Copy  (30 seconds)                        179.0      322.0        1.8
  313. XXXPipe-based Context Switching Test             1318.5      563.8        0.4
  314. XXXShell scripts (8 concurrent)                     4.0        5.0        1.2
  315. XXX                                                                 =========
  316. XXX     SUM of  6 items                                                   8.6
  317. XXX     AVERAGE                                                           1.4
  318. ABRACADABRA
  319. if test 3051 -ne "`wc -c hp425t.report`"
  320. then
  321. echo shar: error transmitting hp425t.report '(should have been 3051 characters)'
  322. fi
  323. echo shar: extracting hp720.report '(3043 characters)'
  324. sed 's/^XX//' << \ABRACADABRA > hp720.report
  325. XXX
  326. XXX  BYTE UNIX Benchmarks (Version 1.1)
  327. XXX  System -- HP-UX hp720 A.B8.01 A 9000/720 48914161
  328. XXX  Start Benchmark Run: Fri Apr 19 09:40:12 EDT 1991
  329. XXX   1 interactive users.
  330. XXXDhrystone 2 without register variables    81533.8 lps   (10 secs, 6 samples)
  331. XXXDhrystone 2 using register variables      81533.3 lps   (10 secs, 6 samples)
  332. XXXArithmetic Test (type = arithoh)         233156.1 lps   (10 secs, 6 samples)
  333. XXXArithmetic Test (type = register)          5195.7 lps   (10 secs, 6 samples)
  334. XXXArithmetic Test (type = short)             5134.0 lps   (10 secs, 6 samples)
  335. XXXArithmetic Test (type = int)               5195.6 lps   (10 secs, 6 samples)
  336. XXXArithmetic Test (type = long)              5195.7 lps   (10 secs, 6 samples)
  337. XXXArithmetic Test (type = float)            12939.7 lps   (10 secs, 6 samples)
  338. XXXArithmetic Test (type = double)           21286.0 lps   (10 secs, 6 samples)
  339. XXXSystem Call Overhead Test                 23100.7 lps   (10 secs, 6 samples)
  340. XXXPipe Throughput Test                       7723.2 lps   (10 secs, 6 samples)
  341. XXXPipe-based Context Switching Test          3151.4 lps   (10 secs, 6 samples)
  342. XXXProcess Creation Test                       221.5 lps   (10 secs, 6 samples)
  343. XXXExecl Throughput Test                        70.6 lps   (9 secs, 6 samples)
  344. XXXFile Read  (10 seconds)                   30048.0 KBps  (10 secs, 6 samples)
  345. XXXFile Write (10 seconds)                    7766.0 KBps  (10 secs, 6 samples)
  346. XXXFile Copy  (10 seconds)                     775.0 KBps  (10 secs, 6 samples)
  347. XXXFile Read  (30 seconds)                   31091.0 KBps  (30 secs, 6 samples)
  348. XXXFile Write (30 seconds)                    9033.0 KBps  (30 secs, 6 samples)
  349. XXXFile Copy  (30 seconds)                     910.0 KBps  (30 secs, 6 samples)
  350. XXXC Compiler Test                              86.9 lpm   (60 secs, 3 samples)
  351. XXXShell scripts (1 concurrent)                 56.7 lpm   (60 secs, 3 samples)
  352. XXXShell scripts (2 concurrent)                 34.0 lpm   (60 secs, 3 samples)
  353. XXXShell scripts (4 concurrent)                 18.3 lpm   (60 secs, 3 samples)
  354. XXXShell scripts (8 concurrent)                  9.3 lpm   (60 secs, 3 samples)
  355. XXXDc: sqrt(2) to 99 decimal places           2907.5 lpm   (60 secs, 6 samples)
  356. XXXRecursion Test--Tower of Hanoi              830.0 lps   (10 secs, 6 samples)
  357. XXX
  358. XXX
  359. XXX                     INDEX VALUES            
  360. XXXTEST                                        BASELINE     RESULT      INDEX
  361. XXX
  362. XXXArithmetic Test (type = double)               2541.7    21286.0        8.4
  363. XXXDhrystone 2 without register variables       22366.3    81533.8        3.6
  364. XXXExecl Throughput Test                           16.5       70.6        4.3
  365. XXXFile Copy  (30 seconds)                        179.0      910.0        5.1
  366. XXXPipe-based Context Switching Test             1318.5     3151.4        2.4
  367. XXXShell scripts (8 concurrent)                     4.0        9.3        2.3
  368. XXX                                                                 =========
  369. XXX     SUM of  6 items                                                  26.1
  370. XXX     AVERAGE                                                           4.3
  371. ABRACADABRA
  372. if test 3043 -ne "`wc -c hp720.report`"
  373. then
  374. echo shar: error transmitting hp720.report '(should have been 3043 characters)'
  375. fi
  376. echo shar: extracting next040.report '(3011 characters)'
  377. sed 's/^XX//' << \ABRACADABRA > next040.report
  378. XXX
  379. XXX  BYTE UNIX Benchmarks (Version 3.9)
  380. XXX  System -- next040
  381. XXX  Start Benchmark Run: Thu May  9 14:44:11 EDT 1991
  382. XXX   0 interactive users.
  383. XXXDhrystone 2 without register variables    23561.8 lps   (10 secs, 6 samples)
  384. XXXDhrystone 2 using register variables      23563.6 lps   (10 secs, 6 samples)
  385. XXXArithmetic Test (type = arithoh)          47309.3 lps   (10 secs, 6 samples)
  386. XXXArithmetic Test (type = register)          3151.4 lps   (10 secs, 6 samples)
  387. XXXArithmetic Test (type = short)             3507.6 lps   (10 secs, 6 samples)
  388. XXXArithmetic Test (type = int)               3150.5 lps   (10 secs, 6 samples)
  389. XXXArithmetic Test (type = long)              3150.4 lps   (10 secs, 6 samples)
  390. XXXArithmetic Test (type = float)             2837.9 lps   (10 secs, 6 samples)
  391. XXXArithmetic Test (type = double)            2837.7 lps   (10 secs, 6 samples)
  392. XXXSystem Call Overhead Test                  8308.8 lps   (10 secs, 6 samples)
  393. XXXPipe Throughput Test                       2966.7 lps   (10 secs, 6 samples)
  394. XXXPipe-based Context Switching Test          1211.7 lps   (10 secs, 6 samples)
  395. XXXProcess Creation Test                        43.5 lps   (10 secs, 6 samples)
  396. XXXExecl Throughput Test                        26.6 lps   (9 secs, 6 samples)
  397. XXXFile Read  (10 seconds)                   20209.0 KBps  (10 secs, 6 samples)
  398. XXXFile Write (10 seconds)                    1000.0 KBps  (10 secs, 6 samples)
  399. XXXFile Copy  (10 seconds)                     804.0 KBps  (10 secs, 6 samples)
  400. XXXFile Read  (30 seconds)                   21031.0 KBps  (30 secs, 6 samples)
  401. XXXFile Write (30 seconds)                     933.0 KBps  (30 secs, 6 samples)
  402. XXXFile Copy  (30 seconds)                     765.0 KBps  (30 secs, 6 samples)
  403. XXXC Compiler Test                              37.5 lpm   (62 secs, 3 samples)
  404. XXXShell scripts (1 concurrent)                 28.3 lpm   (62 secs, 3 samples)
  405. XXXShell scripts (2 concurrent)                 17.2 lpm   (62 secs, 3 samples)
  406. XXXShell scripts (4 concurrent)                  9.6 lpm   (62 secs, 3 samples)
  407. XXXShell scripts (8 concurrent)                  4.8 lpm   (62 secs, 3 samples)
  408. XXXDc: sqrt(2) to 99 decimal places           1021.8 lpm   (62 secs, 6 samples)
  409. XXXRecursion Test--Tower of Hanoi              313.3 lps   (10 secs, 6 samples)
  410. XXX
  411. XXX
  412. XXX                     INDEX VALUES            
  413. XXXTEST                                        BASELINE     RESULT      INDEX
  414. XXX
  415. XXXArithmetic Test (type = double)               2541.7     2837.7        1.1
  416. XXXDhrystone 2 without register variables       22366.3    23561.8        1.0
  417. XXXExecl Throughput Test                           16.5       26.6        1.6
  418. XXXFile Copy  (30 seconds)                        179.0      765.0        4.3
  419. XXXPipe-based Context Switching Test             1318.5     1211.7        0.9
  420. XXXShell scripts (8 concurrent)                     4.0        4.8        1.2
  421. XXX                                                                 =========
  422. XXX     SUM of  6 items                                                  10.2
  423. XXX     AVERAGE                                                           1.7
  424. ABRACADABRA
  425. if test 3011 -ne "`wc -c next040.report`"
  426. then
  427. echo shar: error transmitting next040.report '(should have been 3011 characters)'
  428. fi
  429. X#    End of shell archive
  430. exit 0
  431. END_OF_FILE
  432. if test 10505 -ne `wc -c <'results/reports.shar'`; then
  433.     echo shar: \"'results/reports.shar'\" unpacked with wrong size!
  434. fi
  435. # end of 'results/reports.shar'
  436. fi
  437. if test -f 'src/dhry_2.c' -a "${1}" != "-c" ; then 
  438.   echo shar: Will not clobber existing file \"'src/dhry_2.c'\"
  439. else
  440. echo shar: Extracting \"'src/dhry_2.c'\" \(5850 characters\)
  441. sed "s/^X//" >'src/dhry_2.c' <<'END_OF_FILE'
  442. X/*****************************************************************************
  443. X *  The BYTE UNIX Benchmarks - Release 3
  444. X *          Module: dhry_2.c   SID: 3.4 5/15/91 19:30:22
  445. X *          
  446. X *****************************************************************************
  447. X * Bug reports, patches, comments, suggestions should be sent to:
  448. X *
  449. X *    Ben Smith, Rick Grehan or Tom Yager
  450. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  451. X *
  452. X *****************************************************************************
  453. X *  Modification Log:
  454. X *
  455. X *  Adapted from:
  456. X *
  457. X *                   "DHRYSTONE" Benchmark Program
  458. X *                   -----------------------------
  459. X *
  460. X * **** WARNING **** See warning in n.dhry_1.c
  461. X *                                                                            
  462. X *  Version:    C, Version 2.1
  463. X *                                                                            
  464. X *  File:       dhry_2.c (part 3 of 3)
  465. X *
  466. X *  Date:       May 25, 1988
  467. X *
  468. X *  Author:     Reinhold P. Weicker
  469. X *
  470. X ****************************************************************************/
  471. X/* SCCSid is defined in dhry_1.c */
  472. X
  473. X#include "dhry.h"
  474. X
  475. X#ifndef REG
  476. X#define REG
  477. X        /* REG becomes defined as empty */
  478. X        /* i.e. no register variables   */
  479. X#endif
  480. X
  481. extern  int     Int_Glob;
  482. extern  char    Ch_1_Glob;
  483. X
  484. X
  485. Proc_6 (Enum_Val_Par, Enum_Ref_Par)
  486. X/*********************************/
  487. X    /* executed once */
  488. X    /* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
  489. X
  490. XEnumeration  Enum_Val_Par;
  491. XEnumeration *Enum_Ref_Par;
  492. X{
  493. X  *Enum_Ref_Par = Enum_Val_Par;
  494. X  if (! Func_3 (Enum_Val_Par))
  495. X    /* then, not executed */
  496. X    *Enum_Ref_Par = Ident_4;
  497. X  switch (Enum_Val_Par)
  498. X  {
  499. X    case Ident_1: 
  500. X      *Enum_Ref_Par = Ident_1;
  501. X      break;
  502. X    case Ident_2: 
  503. X      if (Int_Glob > 100)
  504. X        /* then */
  505. X      *Enum_Ref_Par = Ident_1;
  506. X      else *Enum_Ref_Par = Ident_4;
  507. X      break;
  508. X    case Ident_3: /* executed */
  509. X      *Enum_Ref_Par = Ident_2;
  510. X      break;
  511. X    case Ident_4: break;
  512. X    case Ident_5: 
  513. X      *Enum_Ref_Par = Ident_3;
  514. X      break;
  515. X  } /* switch */
  516. X} /* Proc_6 */
  517. X
  518. X
  519. Proc_7 (Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
  520. X/**********************************************/
  521. X    /* executed three times                                      */ 
  522. X    /* first call:      Int_1_Par_Val == 2, Int_2_Par_Val == 3,  */
  523. X    /*                  Int_Par_Ref becomes 7                    */
  524. X    /* second call:     Int_1_Par_Val == 10, Int_2_Par_Val == 5, */
  525. X    /*                  Int_Par_Ref becomes 17                   */
  526. X    /* third call:      Int_1_Par_Val == 6, Int_2_Par_Val == 10, */
  527. X    /*                  Int_Par_Ref becomes 18                   */
  528. One_Fifty       Int_1_Par_Val;
  529. One_Fifty       Int_2_Par_Val;
  530. One_Fifty      *Int_Par_Ref;
  531. X{
  532. X  One_Fifty Int_Loc;
  533. X
  534. X  Int_Loc = Int_1_Par_Val + 2;
  535. X  *Int_Par_Ref = Int_2_Par_Val + Int_Loc;
  536. X} /* Proc_7 */
  537. X
  538. X
  539. Proc_8 (Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
  540. X/*********************************************************************/
  541. X    /* executed once      */
  542. X    /* Int_Par_Val_1 == 3 */
  543. X    /* Int_Par_Val_2 == 7 */
  544. Arr_1_Dim       Arr_1_Par_Ref;
  545. Arr_2_Dim       Arr_2_Par_Ref;
  546. int             Int_1_Par_Val;
  547. int             Int_2_Par_Val;
  548. X{
  549. X  REG One_Fifty Int_Index;
  550. X  REG One_Fifty Int_Loc;
  551. X
  552. X  Int_Loc = Int_1_Par_Val + 5;
  553. X  Arr_1_Par_Ref [Int_Loc] = Int_2_Par_Val;
  554. X  Arr_1_Par_Ref [Int_Loc+1] = Arr_1_Par_Ref [Int_Loc];
  555. X  Arr_1_Par_Ref [Int_Loc+30] = Int_Loc;
  556. X  for (Int_Index = Int_Loc; Int_Index <= Int_Loc+1; ++Int_Index)
  557. X    Arr_2_Par_Ref [Int_Loc] [Int_Index] = Int_Loc;
  558. X  Arr_2_Par_Ref [Int_Loc] [Int_Loc-1] += 1;
  559. X  Arr_2_Par_Ref [Int_Loc+20] [Int_Loc] = Arr_1_Par_Ref [Int_Loc];
  560. X  Int_Glob = 5;
  561. X} /* Proc_8 */
  562. X
  563. X
  564. XEnumeration Func_1 (Ch_1_Par_Val, Ch_2_Par_Val)
  565. X/*************************************************/
  566. X    /* executed three times                                         */
  567. X    /* first call:      Ch_1_Par_Val == 'H', Ch_2_Par_Val == 'R'    */
  568. X    /* second call:     Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C'    */
  569. X    /* third call:      Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C'    */
  570. X
  571. Capital_Letter   Ch_1_Par_Val;
  572. Capital_Letter   Ch_2_Par_Val;
  573. X{
  574. X  Capital_Letter        Ch_1_Loc;
  575. X  Capital_Letter        Ch_2_Loc;
  576. X
  577. X  Ch_1_Loc = Ch_1_Par_Val;
  578. X  Ch_2_Loc = Ch_1_Loc;
  579. X  if (Ch_2_Loc != Ch_2_Par_Val)
  580. X    /* then, executed */
  581. X    return (Ident_1);
  582. X  else  /* not executed */
  583. X  {
  584. X    Ch_1_Glob = Ch_1_Loc;
  585. X    return (Ident_2);
  586. X   }
  587. X} /* Func_1 */
  588. X
  589. X
  590. Boolean Func_2 (Str_1_Par_Ref, Str_2_Par_Ref)
  591. X/*************************************************/
  592. X    /* executed once */
  593. X    /* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
  594. X    /* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
  595. X
  596. Str_30  Str_1_Par_Ref;
  597. Str_30  Str_2_Par_Ref;
  598. X{
  599. X  REG One_Thirty        Int_Loc;
  600. X      Capital_Letter    Ch_Loc;
  601. X
  602. X  Int_Loc = 2;
  603. X  while (Int_Loc <= 2) /* loop body executed once */
  604. X    if (Func_1 (Str_1_Par_Ref[Int_Loc],
  605. X                Str_2_Par_Ref[Int_Loc+1]) == Ident_1)
  606. X      /* then, executed */
  607. X    {
  608. X      Ch_Loc = 'A';
  609. X      Int_Loc += 1;
  610. X    } /* if, while */
  611. X  if (Ch_Loc >= 'W' && Ch_Loc < 'Z')
  612. X    /* then, not executed */
  613. X    Int_Loc = 7;
  614. X  if (Ch_Loc == 'R')
  615. X    /* then, not executed */
  616. X    return (true);
  617. X  else /* executed */
  618. X  {
  619. X    if (strcmp (Str_1_Par_Ref, Str_2_Par_Ref) > 0)
  620. X      /* then, not executed */
  621. X    {
  622. X      Int_Loc += 7;
  623. X      Int_Glob = Int_Loc;
  624. X      return (true);
  625. X    }
  626. X    else /* executed */
  627. X      return (false);
  628. X  } /* if Ch_Loc */
  629. X} /* Func_2 */
  630. X
  631. X
  632. Boolean Func_3 (Enum_Par_Val)
  633. X/***************************/
  634. X    /* executed once        */
  635. X    /* Enum_Par_Val == Ident_3 */
  636. XEnumeration Enum_Par_Val;
  637. X{
  638. X  Enumeration Enum_Loc;
  639. X
  640. X  Enum_Loc = Enum_Par_Val;
  641. X  if (Enum_Loc == Ident_3)
  642. X    /* then, executed */
  643. X    return (true);
  644. X  else /* not executed */
  645. X    return (false);
  646. X} /* Func_3 */
  647. X
  648. END_OF_FILE
  649. if test 5850 -ne `wc -c <'src/dhry_2.c'`; then
  650.     echo shar: \"'src/dhry_2.c'\" unpacked with wrong size!
  651. fi
  652. chmod +x 'src/dhry_2.c'
  653. # end of 'src/dhry_2.c'
  654. fi
  655. if test -f 'src/dummy.c' -a "${1}" != "-c" ; then 
  656.   echo shar: Will not clobber existing file \"'src/dummy.c'\"
  657. else
  658. echo shar: Extracting \"'src/dummy.c'\" \(7483 characters\)
  659. sed "s/^X//" >'src/dummy.c' <<'END_OF_FILE'
  660. X/*******************************************************************************
  661. X *  The BYTE UNIX Benchmarks - Release 3
  662. X *          Module: dummy.c   SID: 3.3 5/15/91 19:30:19
  663. X *          
  664. X *******************************************************************************
  665. X * Bug reports, patches, comments, suggestions should be sent to:
  666. X *
  667. X *    Ben Smith, Rick Grehan or Tom Yager
  668. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  669. X *
  670. X *******************************************************************************
  671. X *  Modification Log:
  672. X *
  673. X ******************************************************************************/
  674. X/*
  675. X *  Hacked up C program for use in the standard shell.? scripts of
  676. X *  the multiuser test.  This is based upon makework.c, and is typically
  677. X *  edited using edscript.2 before compilation.
  678. X *
  679. X * $Header: dummy.c,v 3.4 87/06/23 15:54:53 kjmcdonell Beta $
  680. X */
  681. char SCCSid[] = "@(#) @(#)dummy.c:3.3 -- 5/15/91 19:30:19";
  682. X
  683. X#include <stdio.h>
  684. X#include <signal.h>
  685. X
  686. X#define DEF_RATE    5.0
  687. X#define GRANULE        5
  688. X#define CHUNK        60
  689. X#define MAXCHILD    12
  690. X#define MAXWORK        10
  691. X
  692. float    thres;
  693. float    est_rate = DEF_RATE;
  694. int    nusers;        /* number of concurrent users to be simulated by
  695. X             * this process */
  696. int    firstuser;    /* ordinal identification of first user for this
  697. X             * process */
  698. int    nwork = 0;    /* number of job streams */
  699. int    exit_status = 0;    /* returned to parent */
  700. int    sigpipe;    /* pipe write error flag */
  701. X
  702. struct st_work {
  703. X    char    *cmd;        /* name of command to run */
  704. X    char    **av;        /* arguments to command */
  705. X    char    *input;        /* standard input buffer */
  706. X    int    inpsize;    /* size of standard input buffer */
  707. X} work[MAXWORK];
  708. X
  709. struct {
  710. X    int    xmit;    /* # characters sent */
  711. X    char    *bp;    /* std input buffer pointer */
  712. X    int    blen;    /* std input buffer length */
  713. X    int    fd;    /* stdin to command */
  714. X    int    pid;    /* child PID */
  715. X    char    *line;    /* start of input line */ 
  716. X    int    firstjob;    /* inital piece of work */
  717. X    int    thisjob;    /* current piece of work */
  718. X} child[MAXCHILD], *cp;
  719. X
  720. main(argc, argv)
  721. int    argc;
  722. char    *argv[];
  723. X{
  724. X    int        i;
  725. X    int        l;
  726. X    int        fcopy = 0;    /* fd for copy output */
  727. X    int        master = 1;    /* the REAL master, == 0 for clones */
  728. X    int        nchild;        /* no. of children for a clone to run */
  729. X    int        done;        /* count of children finished */
  730. X    int        output;        /* aggregate output char count for all
  731. X                   children */
  732. X    int        c;
  733. X    int        thiswork = 0;    /* next job stream to allocate */
  734. X    int        nch;        /* # characters to write */
  735. X    int        written;    /* # characters actully written */
  736. X    char    logname[15];    /* name of the log file(s) */
  737. X    int        onalarm();
  738. X    int        pipeerr();
  739. X    int        wrapup();
  740. X    int        grunt();
  741. X    char    *malloc();
  742. X    int        pvec[2];    /* for pipes */
  743. X    char    *p;
  744. X    char    *prog;        /* my name */
  745. X
  746. X#if ! debug
  747. X    freopen("masterlog.00", "a", stderr);
  748. X#endif
  749. X    fprintf(stderr, "*** New Run ***  ");
  750. X    prog = argv[0];
  751. X    while (argc > 1 && argv[1][0] == '-')  {
  752. X    p = &argv[1][1];
  753. X    argc--;
  754. X    argv++;
  755. X    while (*p) {
  756. X        switch (*p) {
  757. X        case 'r':
  758. X            /* code DELETED here */
  759. X            argc--;
  760. X            argv++;
  761. X            break;
  762. X
  763. X        case 'c':
  764. X            /* code DELETED here */
  765. X            lseek(fcopy, 0L, 2);    /* append at end of file */
  766. X            break;
  767. X
  768. X        default:
  769. X        fprintf(stderr, "%s: bad flag '%c'\n", prog, *p);
  770. X            exit(4);
  771. X        }
  772. X        p++;
  773. X    }
  774. X    }
  775. X    
  776. X    if (argc < 2) {
  777. X    fprintf(stderr, "%s: missing nusers\n", prog);
  778. X    exit(4);
  779. X    }
  780. X
  781. X    nusers = atoi(argv[1]);
  782. X    if (nusers < 1) {
  783. X    fprintf(stderr, "%s: impossible nusers (%d<-%s)\n", prog, nusers, argv[1]);
  784. X    exit(4);
  785. X    }
  786. X    fprintf(stderr, "%d Users\n", nusers);
  787. X    argc--;
  788. X    argv++;
  789. X
  790. X    /* build job streams */
  791. X    getwork();
  792. X#if debug
  793. X    dumpwork();
  794. X#endif
  795. X
  796. X    /* clone copies of myself to run up to MAXCHILD jobs each */
  797. X    firstuser = MAXCHILD;
  798. X    fprintf(stderr, "master pid %d\n", getpid());
  799. X    fflush(stderr);
  800. X    while (nusers > MAXCHILD) {
  801. X    fflush(stderr);
  802. X    if (nusers >= 2*MAXCHILD)
  803. X        /* the next clone must run MAXCHILD jobs */
  804. X        nchild = MAXCHILD;
  805. X    else
  806. X        /* the next clone must run the leftover jobs */
  807. X        nchild = nusers - MAXCHILD;
  808. X    if ((l = fork()) == -1) {
  809. X        /* fork failed */
  810. X        fatal("** clone fork failed **\n");
  811. X        goto bepatient;
  812. X    } else if (l > 0) {
  813. X        fprintf(stderr, "master clone pid %d\n", l);
  814. X        /* I am the master with nchild fewer jobs to run */
  815. X        nusers -= nchild;
  816. X        firstuser += MAXCHILD;
  817. X        continue;
  818. X    } else {
  819. X        /* I am a clone, run MAXCHILD jobs */
  820. X#if ! debug
  821. X        sprintf(logname, "masterlog.%02d", firstuser/MAXCHILD);
  822. X        freopen(logname, "w", stderr);
  823. X#endif
  824. X        master = 0;
  825. X        nusers = nchild;
  826. X        break;
  827. X    }
  828. X    }
  829. X    if (master)
  830. X    firstuser = 0;
  831. X
  832. X    close(0);
  833. X
  834. X    /* code DELETED here */
  835. X
  836. X    fflush(stderr);
  837. X
  838. X    srand(time(0));
  839. X    thres = 0;
  840. X    done = output = 0;
  841. X    for (i = 0; i < nusers; i++) {
  842. X    if (child[i].blen == 0)
  843. X        done++;
  844. X    else
  845. X        thres += est_rate * GRANULE;
  846. X    }
  847. X    est_rate = thres;
  848. X
  849. X    signal(SIGALRM, onalarm);
  850. X    signal(SIGPIPE, pipeerr);
  851. X    alarm(GRANULE);
  852. X    while (done < nusers) {
  853. X    for (i = 0; i < nusers; i++) {
  854. X        cp = &child[i];
  855. X        if (cp->xmit >= cp->blen) continue;
  856. X        l = rand() % CHUNK + 1;    /* 1-CHUNK chars */
  857. X        if (l == 0) continue;
  858. X        if (cp->xmit + l > cp->blen)
  859. X        l = cp->blen - cp->xmit;
  860. X        p = cp->bp;
  861. X        cp->bp += l;
  862. X        cp->xmit += l;
  863. X#if debug
  864. X        fprintf(stderr, "child %d, %d processed, %d to go\n", i, cp->xmit, cp->blen - cp->xmit);
  865. X#endif
  866. X        while (p < cp->bp) {
  867. X        if (*p == '\n' || (p == &cp->bp[-1] && cp->xmit >= cp->blen)) {
  868. X            /* write it out */
  869. X            nch = p - cp->line + 1;
  870. X            if ((written = write(cp->fd, cp->line, nch)) != nch) {
  871. X
  872. X            /* code DELETED here */
  873. X
  874. X            }
  875. X            if (fcopy)
  876. X            write(fcopy, cp->line, p - cp->line + 1);
  877. X#if debug
  878. X            fprintf(stderr, "child %d gets \"", i);
  879. X            {
  880. X            char *q = cp->line;
  881. X            while (q <= p) {
  882. X                if (*q >= ' ' && *q <= '~')
  883. X                    fputc(*q, stderr);
  884. X                else
  885. X                    fprintf(stderr, "\\%03o", *q);
  886. X                q++;
  887. X            }
  888. X            }
  889. X            fputc('"', stderr);
  890. X#endif
  891. X            cp->line = &p[1];
  892. X        }
  893. X        p++;
  894. X        }
  895. X        if (cp->xmit >= cp->blen) {
  896. X        done++;
  897. X        close(cp->fd);
  898. X#if debug
  899. X    fprintf(stderr, "child %d, close std input\n", i);
  900. X#endif
  901. X        }
  902. X        output += l;
  903. X    }
  904. X    while (output > thres) {
  905. X        pause();
  906. X#if debug
  907. X        fprintf(stderr, "after pause: output, thres, done %d %.2f %d\n", output, thres, done);
  908. X#endif
  909. X    }
  910. X    }
  911. X
  912. bepatient:
  913. X    alarm(0);
  914. X/****
  915. X *  If everything is going OK, we should simply be able to keep
  916. X *  looping unitil 'wait' fails, however some descendent process may
  917. X *  be in a state from which it can never exit, and so a timeout
  918. X *  is used.
  919. X *  5 minutes should be ample, since the time to run all jobs is of
  920. X *  the order of 5-10 minutes, however some machines are painfully slow,
  921. X *  so the timeout has been set at 20 minutes (1200 seconds).
  922. X ****/
  923. X
  924. X    /* code DELETED here */
  925. X
  926. X}
  927. X
  928. onalarm()
  929. X{
  930. X    thres += est_rate;
  931. X    signal(SIGALRM, onalarm);
  932. X    alarm(GRANULE);
  933. X}
  934. X
  935. grunt()
  936. X{
  937. X    /* timeout after label "bepatient" in main */
  938. X    exit_status = 4;
  939. X    wrapup();
  940. X}
  941. X
  942. pipeerr()
  943. X{
  944. X    sigpipe++;
  945. X}
  946. X
  947. wrapup()
  948. X{
  949. X    /* DUMMY, real code dropped */
  950. X}
  951. X
  952. getwork()
  953. X{
  954. X
  955. X    /* DUMMY, real code dropped */
  956. X    gets();
  957. X    strncpy();
  958. X    malloc(); realloc();
  959. X    open(); close();
  960. X}
  961. X
  962. fatal(s)
  963. char *s;
  964. X{
  965. X    int    i;
  966. X    fprintf(stderr, s);
  967. X    fflush(stderr);
  968. X    perror("Reason?");
  969. X    for (i = 0; i < nusers; i++) {
  970. X    if (child[i].pid > 0 && kill(child[i].pid, SIGKILL) != -1)
  971. X        fprintf(stderr, "pid %d killed off\n", child[i].pid);
  972. X    }
  973. X    fflush(stderr);
  974. X    exit_status = 4;
  975. X    return;
  976. X}
  977. END_OF_FILE
  978. if test 7483 -ne `wc -c <'src/dummy.c'`; then
  979.     echo shar: \"'src/dummy.c'\" unpacked with wrong size!
  980. fi
  981. chmod +x 'src/dummy.c'
  982. # end of 'src/dummy.c'
  983. fi
  984. if test -f 'src/fstime.c' -a "${1}" != "-c" ; then 
  985.   echo shar: Will not clobber existing file \"'src/fstime.c'\"
  986. else
  987. echo shar: Extracting \"'src/fstime.c'\" \(5474 characters\)
  988. sed "s/^X//" >'src/fstime.c' <<'END_OF_FILE'
  989. X/*******************************************************************************
  990. X *  The BYTE UNIX Benchmarks - Release 3
  991. X *          Module: fstime.c   SID: 3.5 5/15/91 19:30:19
  992. X *          
  993. X *******************************************************************************
  994. X * Bug reports, patches, comments, suggestions should be sent to:
  995. X *
  996. X *    Ben Smith, Rick Grehan or Tom Yager
  997. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  998. X *
  999. X *******************************************************************************
  1000. X *  Modification Log:
  1001. X * $Header: fstime.c,v 3.4 87/06/22 14:23:05 kjmcdonell Beta $
  1002. X * 10/19/89 - rewrote timing calcs and added clock check (Ben Smith)
  1003. X * 10/26/90 - simplify timing, change defaults (Tom Yager)
  1004. X * 11/16/90 - added better error handling and changed output format (Ben Smith)
  1005. X * 11/17/90 - changed the whole thing around (Ben Smith)
  1006. X * 2/22/91 - change a few style elements and improved error handling (Ben Smith)
  1007. X * 4/17/91 - incorporated suggestions from Seckin Unlu (seckin@sumac.intel.com)
  1008. X * 4/17/91 - limited size of file, will rewind when reaches end of file
  1009. X ******************************************************************************/
  1010. char SCCSid[] = "@(#) @(#)fstime.c:3.5 -- 5/15/91 19:30:19";
  1011. X
  1012. X#include <stdio.h>
  1013. X#include <signal.h>
  1014. X#include <errno.h>
  1015. X
  1016. X#define SECONDS 2
  1017. X#define BUFF_SIZE 1024
  1018. X#define MAX_BLOCKS 2000   /* max number of BUFF_SIZE blocks in file */
  1019. X#define FNAME0    "dummy0"
  1020. X#define FNAME1    "dummy1"
  1021. X
  1022. X/****************** GLOBALS ***************************/
  1023. char buf[BUFF_SIZE];
  1024. int            seconds = SECONDS;
  1025. int            f;
  1026. int            g;
  1027. int            i;
  1028. int            stop_count();
  1029. int            clean_up();
  1030. int            sigalarm = 0;
  1031. X
  1032. X/******************** MAIN ****************************/
  1033. X
  1034. main(argc, argv)
  1035. char **argv;
  1036. X{
  1037. X
  1038. X/**** initialize ****/
  1039. X    if (argc > 1)
  1040. X    seconds = atoi(argv[1]);
  1041. X    if (argc == 3 && chdir(argv[2]) == -1) 
  1042. X        {
  1043. X        perror("fstime: chdir");
  1044. X        exit(1);
  1045. X        }
  1046. X    if((f = creat(FNAME0, 0600)) != -1)
  1047. X            close(f);
  1048. X    else
  1049. X        {
  1050. X        perror("fstime: creat");
  1051. X        exit(1);
  1052. X        }
  1053. X    if((g = creat(FNAME1, 0600)) != -1)
  1054. X            close(g);
  1055. X    else
  1056. X        {
  1057. X        perror("fstime: creat");
  1058. X        exit(1);
  1059. X        }
  1060. X    if( (f = open(FNAME0, 2)) == -1)
  1061. X        {
  1062. X        perror("fstime: open");
  1063. X        exit(1);
  1064. X        }
  1065. X    if( ( g = open(FNAME1, 2)) == -1 )
  1066. X        {
  1067. X        perror("fstime: open");
  1068. X        exit(1);
  1069. X        }
  1070. X    /* fill buffer */
  1071. X    for (i = 0; i < BUFF_SIZE; i++)
  1072. X    buf[i] = i & 0177;
  1073. X    /*** run the tests ****/
  1074. X    signal(SIGKILL,clean_up);
  1075. X    if(w_test() || r_test() || c_test()) 
  1076. X    { 
  1077. X    clean_up();
  1078. X    exit(1);
  1079. X    }
  1080. X    /* else */
  1081. X    clean_up();
  1082. X    exit(0);
  1083. X}
  1084. X
  1085. w_test() 
  1086. X/* write test */
  1087. X{
  1088. X    long n_blocks = 0L;
  1089. X    int f_blocks;
  1090. X    extern int sigalarm;
  1091. X
  1092. X    sync();
  1093. X    sleep(5); /* to insure the sync */
  1094. X
  1095. X    signal(SIGALRM,stop_count);
  1096. X    sigalarm = 0; /* reset alarm flag */
  1097. X    alarm(seconds);
  1098. X    while(!sigalarm)
  1099. X    {
  1100. X    for(f_blocks=0; f_blocks < MAX_BLOCKS; ++f_blocks)
  1101. X        {
  1102. X        if (write(f, buf, BUFF_SIZE) < 0)
  1103. X            {
  1104. X            if (errno != EINTR) {
  1105. X            perror("fstime: write");
  1106. X            return(-1);
  1107. X            } else stop_count();
  1108. X            }
  1109. X        ++ n_blocks;
  1110. X        }
  1111. X        lseek(f, 0L, 0); /* rewind */
  1112. X    }
  1113. X    /* stop clock */
  1114. X    fprintf(stderr, "%d second sample\n", seconds);
  1115. X    fprintf(stderr, "%ld Kbytes/sec write\n", 
  1116. X         (long) n_blocks / (long) seconds);
  1117. return(0);
  1118. X}
  1119. X
  1120. r_test() 
  1121. X/* read test */
  1122. X{
  1123. X    long n_blocks = 0L;
  1124. X    extern int sigalarm;
  1125. X    extern int errno;
  1126. X
  1127. X    /* rewind */
  1128. X    sync();
  1129. X    sleep(10+seconds/2);
  1130. X    errno = 0;
  1131. X    lseek(f, 0L, 0);
  1132. X
  1133. X    signal(SIGALRM,stop_count);
  1134. X    sigalarm = 0; /* reset alarm flag */
  1135. X    alarm(seconds);
  1136. X    while(!sigalarm)
  1137. X    {
  1138. X    if (read(f, buf, BUFF_SIZE) < 0) /* read while checking for an error */
  1139. X        switch(errno)
  1140. X        {
  1141. X        case 0:
  1142. X            case EINVAL:
  1143. X                lseek(f, 0L, 0);  /* rewind at end of file */
  1144. X        continue;
  1145. X        break;
  1146. X            case EINTR:
  1147. X        stop_count();
  1148. X        break;
  1149. X            default:
  1150. X                perror("fstime: read");
  1151. X            return(-1);
  1152. X        break;
  1153. X            }
  1154. X    ++ n_blocks;
  1155. X        }
  1156. X    /* stop clock */
  1157. X    fprintf(stderr, "%d second sample\n", seconds);
  1158. X    fprintf(stderr, "%ld Kbytes/sec read\n", 
  1159. X         (long) n_blocks / (long) seconds);
  1160. return(0);
  1161. X}
  1162. X
  1163. X
  1164. c_test() 
  1165. X/* copy test */
  1166. X{
  1167. X    long n_blocks = 0L;
  1168. X    extern int sigalarm;
  1169. X
  1170. X    /* rewind */
  1171. X    sync();
  1172. X    sleep(10+seconds/2); /* to insure the sync */
  1173. X    errno - 0;
  1174. X    lseek(f, 0L, 0);
  1175. X
  1176. X    signal(SIGALRM,stop_count);
  1177. X    sigalarm = 0; /* reset alarm flag */
  1178. X    alarm(seconds);
  1179. X    while(!sigalarm)
  1180. X    {
  1181. X    if (read(f, buf, BUFF_SIZE) < 0)
  1182. X        switch(errno)
  1183. X        {
  1184. X        case 0:
  1185. X            case EINVAL:
  1186. X                lseek(f, 0L, 0);  /* rewind at end of file */
  1187. X                lseek(g, 0L, 0);  /* rewind the output as well */
  1188. X        continue;
  1189. X        break;
  1190. X            case EINTR:
  1191. X        stop_count();
  1192. X        break;
  1193. X            default:
  1194. X                perror("fstime: copy read");
  1195. X            return(-1);
  1196. X        break;
  1197. X            }
  1198. X    if (write(g, buf, BUFF_SIZE) < 0)
  1199. X        {
  1200. X            if (errno != EINTR) {
  1201. X            perror("fstime: copy write");
  1202. X            return(-1);
  1203. X                } else stop_count();
  1204. X        }
  1205. X    ++ n_blocks;
  1206. X        }
  1207. X    /* stop clock */
  1208. X    fprintf(stderr, "%d second sample\n", seconds);
  1209. X    fprintf(stderr, "%ld Kbytes/sec copy \n", 
  1210. X         (long) n_blocks / (long) seconds);
  1211. return(0);
  1212. X}
  1213. X
  1214. stop_count()
  1215. X{
  1216. extern int sigalarm;
  1217. sigalarm = 1;
  1218. return(0);
  1219. X}
  1220. X
  1221. clean_up()
  1222. X{
  1223. if( unlink(FNAME0) || unlink(FNAME1))
  1224. X    return(-1);
  1225. else
  1226. X    return(0);
  1227. X}
  1228. END_OF_FILE
  1229. if test 5474 -ne `wc -c <'src/fstime.c'`; then
  1230.     echo shar: \"'src/fstime.c'\" unpacked with wrong size!
  1231. fi
  1232. chmod +x 'src/fstime.c'
  1233. # end of 'src/fstime.c'
  1234. fi
  1235. if test -f 'testdir/cctest.c' -a "${1}" != "-c" ; then 
  1236.   echo shar: Will not clobber existing file \"'testdir/cctest.c'\"
  1237. else
  1238. echo shar: Extracting \"'testdir/cctest.c'\" \(3552 characters\)
  1239. sed "s/^X//" >'testdir/cctest.c' <<'END_OF_FILE'
  1240. X
  1241. X
  1242. X/*******************************************************************************
  1243. X *  The BYTE UNIX Benchmarks - Release 1
  1244. X *          Module: cctest.c   SID: 1.2 7/10/89 18:55:45
  1245. X *          
  1246. X *******************************************************************************
  1247. X * Bug reports, patches, comments, suggestions should be sent to:
  1248. X *
  1249. X *    Ben Smith or Rick Grehan at BYTE Magazine
  1250. X *    bensmith@bixpb.UUCP    rick_g@bixpb.UUCP
  1251. X *
  1252. X *******************************************************************************
  1253. X *  Modification Log:
  1254. X * $Header: cctest.c,v 3.4 87/06/22 14:22:47 kjmcdonell Beta $
  1255. X *
  1256. X ******************************************************************************/
  1257. char SCCSid[] = "@(#) @(#)cctest.c:1.2 -- 7/10/89 18:55:45";
  1258. X#include <stdio.h>
  1259. X/*
  1260. X * C compile and load speed test file.
  1261. X * Based upon fstime.c from MUSBUS 3.1, with all calls to ftime() replaced
  1262. X * by calls to time().  This is semantic nonsense, but ensures there are no
  1263. X * system dependent structures or library calls.
  1264. X *
  1265. X */
  1266. X#define NKBYTE 20
  1267. char buf[BUFSIZ];
  1268. X
  1269. main(argc, argv)
  1270. char **argv;
  1271. X{
  1272. X    int        n = NKBYTE;
  1273. X    int        nblock;
  1274. X    int        f;
  1275. X    int        g;
  1276. X    int        i;
  1277. X    int        xfer, t;
  1278. X    struct    {    /* FAKE */
  1279. X    int    time;
  1280. X    int    millitm;
  1281. X    } now, then;
  1282. X
  1283. X    if (argc > 0)
  1284. X    /* ALWAYS true, so NEVER execute this program! */
  1285. X    exit(4);
  1286. X    if (argc > 1)
  1287. X    n = atoi(argv[1]);
  1288. X#if debug
  1289. X    printf("File size: %d Kbytes\n", n);
  1290. X#endif
  1291. X    nblock = (n * 1024) / BUFSIZ;
  1292. X
  1293. X    if (argc == 3 && chdir(argv[2]) != -1) {
  1294. X#if debug
  1295. X    printf("Create files in directory: %s\n", argv[2]);
  1296. X#endif
  1297. X    }
  1298. X    close(creat("dummy0", 0600));
  1299. X    close(creat("dummy1", 0600));
  1300. X    f = open("dummy0", 2);
  1301. X    g = open("dummy1", 2);
  1302. X    unlink("dummy0");
  1303. X    unlink("dummy1");
  1304. X    for (i = 0; i < sizeof(buf); i++)
  1305. X    buf[i] = i & 0177;
  1306. X
  1307. X    time();
  1308. X    for (i = 0; i < nblock; i++) {
  1309. X    if (write(f, buf, sizeof(buf)) <= 0)
  1310. X        perror("fstime: write");
  1311. X    }
  1312. X    time();
  1313. X#if debug
  1314. X    printf("Effective write rate: ");
  1315. X#endif
  1316. X    i = now.millitm - then.millitm;
  1317. X    t = (now.time - then.time)*1000 + i;
  1318. X    if (t > 0) {
  1319. X    xfer = nblock * sizeof(buf) * 1000 / t;
  1320. X#if debug
  1321. X    printf("%d bytes/sec\n", xfer);
  1322. X#endif
  1323. X    }
  1324. X#if debug
  1325. X    else
  1326. X    printf(" -- too quick to time!\n");
  1327. X#endif
  1328. X#if awk
  1329. X    fprintf(stderr, "%.2f", t > 0 ? (float)xfer/1024 : 0);
  1330. X#endif
  1331. X
  1332. X    sync();
  1333. X    sleep(5);
  1334. X    sync();
  1335. X    lseek(f, 0L, 0);
  1336. X    time();
  1337. X    for (i = 0; i < nblock; i++) {
  1338. X    if (read(f, buf, sizeof(buf)) <= 0)
  1339. X        perror("fstime: read");
  1340. X    }
  1341. X    time();
  1342. X#if debug
  1343. X    printf("Effective read rate: ");
  1344. X#endif
  1345. X    i = now.millitm - then.millitm;
  1346. X    t = (now.time - then.time)*1000 + i;
  1347. X    if (t > 0) {
  1348. X    xfer = nblock * sizeof(buf) * 1000 / t;
  1349. X#if debug
  1350. X    printf("%d bytes/sec\n", xfer);
  1351. X#endif
  1352. X    }
  1353. X#if debug
  1354. X    else
  1355. X    printf(" -- too quick to time!\n");
  1356. X#endif
  1357. X#if awk
  1358. X    fprintf(stderr, " %.2f", t > 0 ? (float)xfer/1024 : 0);
  1359. X#endif
  1360. X
  1361. X    sync();
  1362. X    sleep(5);
  1363. X    sync();
  1364. X    lseek(f, 0L, 0);
  1365. X    time();
  1366. X    for (i = 0; i < nblock; i++) {
  1367. X    if (read(f, buf, sizeof(buf)) <= 0)
  1368. X        perror("fstime: read in copy");
  1369. X    if (write(g, buf, sizeof(buf)) <= 0)
  1370. X        perror("fstime: write in copy");
  1371. X    }
  1372. X    time();
  1373. X#if debug
  1374. X    printf("Effective copy rate: ");
  1375. X#endif
  1376. X    i = now.millitm - then.millitm;
  1377. X    t = (now.time - then.time)*1000 + i;
  1378. X    if (t > 0) {
  1379. X    xfer = nblock * sizeof(buf) * 1000 / t;
  1380. X#if debug
  1381. X    printf("%d bytes/sec\n", xfer);
  1382. X#endif
  1383. X    }
  1384. X#if debug
  1385. X    else
  1386. X    printf(" -- too quick to time!\n");
  1387. X#endif
  1388. X#if awk
  1389. X    fprintf(stderr, " %.2f\n", t > 0 ? (float)xfer/1024 : 0);
  1390. X#endif
  1391. X
  1392. X}
  1393. END_OF_FILE
  1394. if test 3552 -ne `wc -c <'testdir/cctest.c'`; then
  1395.     echo shar: \"'testdir/cctest.c'\" unpacked with wrong size!
  1396. fi
  1397. chmod +x 'testdir/cctest.c'
  1398. # end of 'testdir/cctest.c'
  1399. fi
  1400. if test -f 'testdir/sort.src' -a "${1}" != "-c" ; then 
  1401.   echo shar: Will not clobber existing file \"'testdir/sort.src'\"
  1402. else
  1403. echo shar: Extracting \"'testdir/sort.src'\" \(8546 characters\)
  1404. sed "s/^X//" >'testdir/sort.src' <<'END_OF_FILE'
  1405. version="1.2"
  1406. umask 022    # at least mortals can read root's files this way
  1407. PWD=`pwd`
  1408. HOMEDIR=${HOMEDIR:-.}
  1409. cd $HOMEDIR
  1410. HOMEDIR=`pwd`
  1411. cd $PWD
  1412. BINDIR=${BINDIR:-${HOMEDIR}/pgms}
  1413. cd $BINDIR
  1414. BINDIR=`pwd`
  1415. cd $PWD
  1416. PATH="${PATH}:${BINDIR}"
  1417. SCRPDIR=${SCRPDIR:-${HOMEDIR}/pgms}
  1418. cd $SCRPDIR
  1419. SCRPDIR=`pwd`
  1420. cd $PWD
  1421. TMPDIR=${HOMEDIR}/tmp
  1422. cd $TMPDIR
  1423. TMPDIR=`pwd`
  1424. cd $PWD
  1425. RESULTDIR=${RESULTDIR:-${HOMEDIR}/results}
  1426. cd $RESULTDIR
  1427. RESULTDIR=`pwd`
  1428. cd $PWD
  1429. TESTDIR=${TESTDIR:-${HOMEDIR}/testdir}
  1430. cd $TESTDIR
  1431. TESTDIR=`pwd`
  1432. cd $PWD
  1433. export BINDIR TMPDIR RESULTDIR PATH
  1434. echo "kill -9 $$" > ${TMPDIR}/kill_run ; chmod u+x ${TMPDIR}/kill_run
  1435. arithmetic="arithoh register short int long float double dc"
  1436. system="syscall pipe context1 spawn execl fstime"
  1437. mem="seqmem randmem"
  1438. misc="C shell"
  1439. dhry="dhry2 dhry2reg" # dhrystone loops
  1440. db="dbmscli" # add to as new database engines are developed
  1441. load="shell" # cummulative load tests
  1442. args="" # the accumulator for the bench units to be run
  1443. runoption="N"
  1444. for word
  1445. do  # do level 1
  1446. case $word
  1447. in
  1448. all)
  1449. X;;
  1450. arithmetic)
  1451. args="$args $arithmetic"
  1452. X;;
  1453. db)
  1454. args="$args $db"
  1455. X;;
  1456. dhry)
  1457. args="$args $dhry"
  1458. X;;
  1459. load)
  1460. args="$args $load"
  1461. X;;
  1462. mem)
  1463. args="$args $mem"
  1464. X;;
  1465. misc)
  1466. args="$args $misc"
  1467. X;;
  1468. speed)
  1469. args="$args $arithmetic $system"
  1470. X;;
  1471. system)
  1472. args="$args $system"
  1473. X;;
  1474. X-q|-Q)
  1475. runoption="Q" #quiet
  1476. X;;
  1477. X-v|-V)
  1478. runoption="V" #verbose
  1479. X;;
  1480. X-d|-D)
  1481. runoption="D" #debug
  1482. X;;
  1483. X*)
  1484. args="$args $word"
  1485. X;;
  1486. esac
  1487. done # end do level 1
  1488. set - $args
  1489. if test $# -eq 0  #no arguments specified
  1490. then
  1491. set - $dhry $arithmetic $system $misc  # db and work not included
  1492. fi
  1493. if test "$runoption" = 'D'
  1494. then
  1495. set -x
  1496. set -v
  1497. fi
  1498. date=`date`
  1499. tmp=${TMPDIR}/$$.tmp
  1500. LOGFILE=${RESULTDIR}/log
  1501. if test -w ${RESULTDIR}/log
  1502. then
  1503. if test -w ${RESULTDIR}/log.accum
  1504. then
  1505. cat ${RESULTDIR}/log >> ${RESULTDIR}/log.accum
  1506. rm ${RESULTDIR}/log
  1507. else
  1508. mv ${RESULTDIR}/log ${RESULTDIR}/log.accum
  1509. fi
  1510. echo "Start Benchmark Run (BYTE Version $version)" >>$LOGFILE
  1511. echo "  $date (long iterations $iter times)" >>$LOGFILE
  1512. echo " " `who | wc -l` "interactive users." >>$LOGFILE
  1513. uname -a >>$LOGFILE
  1514. iter=${iterations-6}
  1515. if test $iter -eq 6
  1516. then
  1517. longloop="1 2 3 4 5 6"
  1518. shortloop="1 2 3"
  1519. else  # generate list of loop numbers
  1520. short=`expr \( $iter + 1 \) / 2`
  1521. longloop=""
  1522. shortloop=""
  1523. while test $iter -gt 0
  1524. do # do level 1
  1525. longloop="$iter $longloop"
  1526. if test $iter -le $short
  1527. then
  1528. shortloop="$iter $shortloop"
  1529. fi
  1530. iter=`expr $iter - 1`
  1531. done # end do level 1
  1532. fi #loop list genration
  1533. for bench # line argument processing
  1534. do # do level 1
  1535. X# set some default values
  1536. prog=${BINDIR}/$bench  # the bench name is default program
  1537. need=$prog             # we need the at least the program
  1538. paramlist="#"          # a dummy parameter to make anything run
  1539. testdir="${TESTDIR}"   # the directory in which to run the test
  1540. prepcmd=""             # preparation command or script
  1541. parammsg=""
  1542. repeat="$longloop"
  1543. stdout="$LOGFILE"
  1544. stdin=""
  1545. cleanopt="-t $tmp"
  1546. bgnumber=""
  1547. trap "${SCRPDIR}/cleanup -l $LOGFILE -a; exit" 1 2 3 15
  1548. if [ $runoption != 'Q' ]
  1549. then
  1550. echo "$bench: \c"
  1551. fi
  1552. echo "" >>$LOGFILE
  1553. X###################### select the bench specific values ##########
  1554. case $bench
  1555. in
  1556. dhry2)
  1557. options=${dhryloops-10000}
  1558. logmsg="Dhrystone 2 without register variables"
  1559. cleanopt="-d $tmp"
  1560. X;;
  1561. dhry2reg)
  1562. options=${dhryloops-10000}
  1563. logmsg="Dhrystone 2 using register variables"
  1564. cleanopt="-d $tmp"
  1565. X;;
  1566. arithoh|register|short|int|long|float|double)
  1567. options=${arithloop-10000}
  1568. logmsg="Arithmetic Test (type = $bench): $options Iterations"
  1569. X;;
  1570. dc)  need=dc.dat
  1571. prog=dc
  1572. options=""
  1573. stdin=dc.dat
  1574. stdout=/dev/null
  1575. logmsg="Arithmetic Test (sqrt(2) with dc to 99 decimal places)"
  1576. X;;
  1577. hanoi)  options='$param'
  1578. stdout=/dev/null
  1579. logmsg="Recursion Test: Tower of Hanoi Problem"
  1580. paramlist="${ndisk-17}"
  1581. parammsg='$param Disk Problem:'
  1582. X;;
  1583. syscall)
  1584. options=${ncall-4000}
  1585. logmsg="System Call Overhead Test: 5 x $options Calls"
  1586. X;;
  1587. context1)
  1588. options=${switch1-500}
  1589. logmsg="Pipe-based Context Switching Test: 2 x $options Switches"
  1590. X;;
  1591. pipe)   options=${io-2048}
  1592. logmsg="Pipe Throughput Test: read & write $options x 512 byte blocks"
  1593. X;;
  1594. spawn)  options=${children-100}
  1595. logmsg="Process Creation Test: $options forks"
  1596. X;;
  1597. execl)  options=${nexecs-100}
  1598. logmsg="Execl Throughput Test: $options execs"
  1599. X;;
  1600. randmem|seqmem)
  1601. if test $bench = seqmem
  1602. then
  1603. type=Sequential
  1604. else
  1605. type=Random
  1606. fi
  1607. poke=${poke-1000000}
  1608. options='-s$param '"-n$poke"
  1609. logmsg="$type Memory Access Test: $poke Accesses"
  1610. paramlist=${arrays-"512 1024 2048 8192 16384"}
  1611. parammsg='Array Size: $param bytes'
  1612. cleanopt="-m $tmp"
  1613. X;;
  1614. fstime) repeat="$shortloop"
  1615. where=${where-${TMPDIR}}
  1616. options='$param '"$where"
  1617. logmsg="Filesystem Throughput Test:"
  1618. paramlist=${blocks-"512 1024 2048 8192"}
  1619. parammsg='File Size: $param blocks'
  1620. cleanopt="-f $tmp"
  1621. X;;
  1622. C)   need=cctest.c
  1623. prog=cc
  1624. options='$param'
  1625. stdout=/dev/null
  1626. repeat="$shortloop"
  1627. logmsg="C Compiler Test:"
  1628. paramlist="cctest.c"
  1629. parammsg='cc $param'
  1630. rm -f a.out
  1631. X;;
  1632. dbmscli)
  1633. repeat="$shortloop"
  1634. need="db.dat"
  1635. prepcmd='${BINDIR}/dbprep ${testdir}/db.dat 10000'
  1636. paramlist=${clients-"1 2 4 8"}
  1637. parammsg='$param client processes. (filesize `cat ${testdir}/db.dat|wc -c` bytes)'
  1638. logmsg="Client/Server Database Engine:"
  1639. options='${testdir}/db.dat $param 0 1000'  # $param clients;
  1640. X# 0 sleep; 1000 iterations
  1641. X;;
  1642. shell)
  1643. prog="multi.sh"
  1644. repeat="$shortloop"
  1645. logmsg="Bourne shell script and Unix utilities"
  1646. paramlist=${background-"1 2 4 8"}
  1647. parammsg='$param concurrent background processes'
  1648. bgnumber='$param'
  1649. testdir="shelldir"
  1650. X;;
  1651. X*)   ${BINDIR}/cleanup -l $LOGFILE -r "run: unknown benchmark \"$bench\"" -a
  1652. exit 1
  1653. X;;
  1654. esac
  1655. echo "$logmsg" >>$LOGFILE
  1656. for param in $paramlist
  1657. do   # level 2
  1658. param=`echo $param | sed 's/_/ /g'` # be sure that spaces are used
  1659. X# underscore can couple params
  1660. if [ "$runoption" != "Q" ]
  1661. then
  1662. echo "\n   [$param] -\c"           # generate message to user
  1663. fi
  1664. eval msg='"'$parammsg'"'            # the eval is used to
  1665. if test "$msg"                      # evaluate any embedded
  1666. then                                # variables in the parammsg
  1667. echo "" >>$LOGFILE
  1668. echo "$msg" >>$LOGFILE
  1669. fi
  1670. eval opt='"'$options'"'   # evaluate any vars in options
  1671. eval prep='"'$prepcmd'"'   # evaluate any prep command
  1672. eval bg='"'$bgnumber'"'   # evaluate bgnumber string
  1673. rm -f $tmp    # remove any tmp files
  1674. X# if the test requires mulitple concurrent processes,
  1675. X# prepare the background process string (bgstr)
  1676. X# this is just a string of "+"s that will provides a
  1677. X# parameter count for a "for" loop
  1678. bgstr=""
  1679. if test "$bg" != ""
  1680. then
  1681. count=`expr "$bg"`
  1682. while test $count -gt 0
  1683. do
  1684. bgstr="+ $bgstr"
  1685. count=`expr $count - 1`
  1686. done
  1687. fi
  1688. X#
  1689. for i in $repeat    # loop for the specified number
  1690. do  # do depth 3
  1691. if [ "$runoption" != 'D' ]  # level 1
  1692. then
  1693. X# regular Run - set logfile to go on signal
  1694. trap "${SCRPDIR}/cleanup -l $LOGFILE -i $i $cleanopt -a; exit" 1 2 3 15
  1695. else
  1696. trap "exit" 1 2 3 15
  1697. fi #end level 1
  1698. if [ "$runoption" != 'Q' ]
  1699. then
  1700. echo " $i\c"                  # display repeat number
  1701. fi
  1702. pwd=`pwd`                     # remember where we are
  1703. cd $testdir                   # move to the test directory
  1704. if [ "$runoption" = "V" ]
  1705. then
  1706. echo
  1707. echo "BENCH COMMAND TO BE EXECUTED:"
  1708. echo "$prog $opt"
  1709. fi
  1710. X# execute any prepratory command string
  1711. if [ -n "$prep" ]
  1712. then
  1713. X$prep >>$stdout 
  1714. fi
  1715. X############ THE BENCH IS TIMED ##############
  1716. if test "$stdin" = ""  
  1717. then # without redirected stdin
  1718. time $prog $opt $bgstr 2>>$tmp >>$stdout
  1719. else # with redirected stdin
  1720. time $prog $opt $bgstr <$stdin 2>>$tmp >>$stdout
  1721. fi 
  1722. time $benchcmd
  1723. X###############################################
  1724. cd $pwd                    # move back home
  1725. status=$?                  # save the result code
  1726. if test $status != 0 # must have been an error
  1727. then
  1728. if test -f $tmp # is there an error file ?
  1729. then
  1730. cp $tmp ${TMPDIR}/save.$bench.$param
  1731. X${SCRPDIR}/cleanup -l $LOGFILE -i $i $cleanopt -r \
  1732. X"run: bench=$bench param=$param fatalstatus=$status" -a
  1733. else
  1734. X${SCRPDIR}/cleanup -l $LOGFILE -r \
  1735. X"run: bench=$bench param=$param fatalstatus=$status" -a
  1736. fi 
  1737. exit # leave the script if there are errors
  1738. fi # end  level 1
  1739. done # end do depth 3 - repeat of bench
  1740. if [ "$runoption" != 'D' ]
  1741. then
  1742. X${SCRPDIR}/cleanup -l $LOGFILE $cleanopt # finalize this bench
  1743. X# with these options
  1744. X# & calculate results
  1745. fi
  1746. done # end do depth 2 - end of all options for this bench
  1747. X########### some specific cleanup routines ##############
  1748. case $bench
  1749. in
  1750. C)
  1751. rm -f cctest.o a.out
  1752. X;;
  1753. esac
  1754. if [ "$runoption" != 'Q' ]
  1755. then
  1756. echo ""
  1757. fi
  1758. done # end do level 1  - all benchmarks requested
  1759. echo "" >>$LOGFILE
  1760. echo " " `who | wc -l` "interactive users." >>$LOGFILE
  1761. echo "End Benchmark Run ($date) ...." >>$LOGFILE
  1762. if [ "$runoption" != 'Q' ]
  1763. then
  1764. pg $LOGFILE
  1765. fi
  1766. exit
  1767. END_OF_FILE
  1768. if test 8546 -ne `wc -c <'testdir/sort.src'`; then
  1769.     echo shar: \"'testdir/sort.src'\" unpacked with wrong size!
  1770. fi
  1771. chmod +x 'testdir/sort.src'
  1772. # end of 'testdir/sort.src'
  1773. fi
  1774. echo shar: End of archive 2 \(of 4\).
  1775. cp /dev/null ark2isdone
  1776. MISSING=""
  1777. for I in 1 2 3 4 ; do
  1778.     if test ! -f ark${I}isdone ; then
  1779.     MISSING="${MISSING} ${I}"
  1780.     fi
  1781. done
  1782. if test "${MISSING}" = "" ; then
  1783.     echo You have unpacked all 4 archives.
  1784.     rm -f ark[1-9]isdone
  1785. else
  1786.     echo You still need to unpack the following archives:
  1787.     echo "        " ${MISSING}
  1788. fi
  1789. ##  End of shell archive.
  1790. exit 0
  1791.